-
-
Notifications
You must be signed in to change notification settings - Fork 2
BREAKING CHNAGE: Upgrade commit-check to v2.0.0 #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughCommit-check enforcement moved from inline action inputs and Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer
participant GH as GitHub Actions
participant Action as commit-check Action
participant Entrypoint as main.py
participant CLI as commit-check CLI (v2)
participant CFG as commit-check.toml
Dev->>GH: Push / Open PR
GH->>Action: Start commit-check job
Action->>Entrypoint: Run composite action
Entrypoint->>CLI: Execute commit-check (flags: message, branch, author-name, author-email...)
CLI->>CFG: Load TOML policy (commit & branch rules)
CLI-->>Entrypoint: Return results (pass / fail)
Entrypoint-->>GH: Report outcome
Note right of CFG: Enforcement moved from inline YAML/inputs to `commit-check.toml` and CLI v2
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Commit-Check ✔️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.commit-check.yml
(0 hunks).github/workflows/release.yaml
(2 hunks)README.md
(1 hunks)commit-check.toml
(1 hunks)requirements.txt
(1 hunks)
💤 Files with no reviewable changes (1)
- .commit-check.yml
🔇 Additional comments (4)
requirements.txt (1)
3-3
: Upgrade looks good.Pin to commit-check 2.0.0 aligns with v2 migration.
README.md (2)
43-43
: LGTM on action upgrade reference.Switch to commit-check-action@v2 is correct.
144-145
: Please provide the repository URL or package name for commit-check v2 so I can locate the canonical default configuration file (commit-check.toml) and its URL.commit-check.toml (1)
1-23
: Provide commit-check v2 docs link
Please share the GitHub repo or documentation URL for the commit-check tool (v2) you’re using so we can confirm that keys likesubject_imperative
,conventional_branch
, andrequire_rebase_target
are valid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
README.md (1)
121-121
: Update the config filename reference.We now ship a
commit-check.toml
, yet the doc still instructs users to add.commit-check.yml
. Following this guidance with v2 will silently fail because the CLI won’t read the YAML file. Please update the link and wording to.toml
so users can customise successfully.
🧹 Nitpick comments (1)
README.md (1)
41-43
: Refresh the fetch-depth comment.The merge-base input no longer exists in v2, so the “required for merge-base check” note is stale. Please reword to reflect the current need (e.g., fetching full history for rebase-target validation) or drop it.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
.commit-check.yml
(0 hunks).github/workflows/commit-check.yml
(0 hunks).github/workflows/release.yaml
(2 hunks)README.md
(1 hunks)action.yml
(0 hunks)commit-check.toml
(1 hunks)main.py
(0 hunks)requirements.txt
(1 hunks)
💤 Files with no reviewable changes (4)
- .commit-check.yml
- .github/workflows/commit-check.yml
- main.py
- action.yml
c427042
to
70a31f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
README.md
(4 hunks)action.yml
(1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
README.md
15-15: Blank line inside blockquote
(MD028, no-blanks-blockquote)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
README.md (1)
13-17
: MD028 (no-blanks-blockquote) resolvedThe spacer line inside the callout is now correctly prefixed with
>
. LGTM.
🧹 Nitpick comments (1)
README.md (1)
135-135
: Polish wording for clarityMinor grammar tweak to improve readability.
-Note: the default rule of above inputs is following [this configuration](https://github.com/commit-check/commit-check-action/blob/main/commit-check.toml). If you want to customize, just add your [`commit-check.toml`](https://commit-check.github.io/commit-check/configuration.html) config file under your repository root directory. +Note: the default behavior of the above inputs follows [this configuration](https://github.com/commit-check/commit-check-action/blob/main/commit-check.toml). To customize, add a [`commit-check.toml`](https://commit-check.github.io/commit-check/configuration.html) file at the repository root.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
README.md
(4 hunks)
🔇 Additional comments (3)
README.md (3)
20-23
: Breaking changes list is clear and consistentBullets accurately reflect input removals and defaults moving to commit-check.toml. LGTM.
25-25
: Verify release notes link/date before mergingEnsure the tag
v2.0.0
and the date shown in What's New match the actual release.Would you confirm the tag exists and the date is correct?
65-66
: Defaults aligned with v2 behaviorSetting
author-name
andauthor-email
tofalse
by default matches the stated breaking change. LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (5)
README.md (5)
18-21
: Tighten “Breaking Changes” wording for clarityMinor phrasing improvements to avoid “dropped support … moved” ambiguity and reference v2 defaults.
-- Dropped support for `commit-signoff`, `merge-base`, and `imperative` inputs which are moved to new config file `commit-check.toml`. +- Removed action inputs `commit-signoff`, `merge-base`, and `imperative`; these are now configured in `commit-check.toml`. - Dropped support for `.commit-check.yml` in favor of `commit-check.toml`. -- Changed default values of `author-name` and `author-email` inputs to `false` to align with commit-check default configuration. +- Changed defaults for `author-name` and `author-email` inputs to `false` to align with commit‑check v2 defaults.
61-62
: Omit redundant inputs (already default false)Docs say these default to false; removing keeps the example minimal.
- author-name: false - author-email: false
93-93
: Polish wording formessage
descriptionSmall grammar/casing tweak.
-- **Description**: check git commit message following [Conventional Commits](https://www.conventionalcommits.org/). +- **Description**: Check Git commit messages follow [Conventional Commits](https://www.conventionalcommits.org/).
98-98
: Polish wording forbranch
descriptionSmall grammar/casing tweak.
-- **Description**: check git branch name following [Conventional Branch](https://conventional-branch.github.io/). +- **Description**: Check Git branch names follow [Conventional Branch](https://conventional-branch.github.io/).
131-131
: Clarify “Note” grammar and pluralization-Note: the default rule of above inputs is following [this configuration](https://github.com/commit-check/commit-check-action/blob/main/commit-check.toml). If you want to customize, just add your [`commit-check.toml`](https://commit-check.github.io/commit-check/configuration.html) config file under your repository root directory. +Note: the default rules for the above inputs follow [this configuration](https://github.com/commit-check/commit-check-action/blob/main/commit-check.toml). To customize, add your own [`commit-check.toml`](https://commit-check.github.io/commit-check/configuration.html) at the repository root.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
README.md
(4 hunks)
🔇 Additional comments (1)
README.md (1)
11-15
: v2 section and callout look goodClear, concise, and lint-friendly. No issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (1)
README.md (1)
53-55
: Make checkout ref robust for push and PR events
${{ github.event.pull_request.head.sha }}
is undefined on push events; provide a fallback togithub.sha
so the example works for both.Apply:
- ref: ${{ github.event.pull_request.head.sha }} # Checkout PR HEAD commit + ref: ${{ github.event.pull_request.head.sha || github.sha }} # PR HEAD on PRs; current SHA on pushes fetch-depth: 0 # Required for merge-base checks
🧹 Nitpick comments (3)
README.md (3)
93-93
: Tighten phrasing (grammar/style)Use imperative style consistent with others.
- - **Description**: check git commit message following [Conventional Commits](https://www.conventionalcommits.org/). + - **Description**: Check Git commit messages follow [Conventional Commits](https://www.conventionalcommits.org/).
98-98
: Tighten phrasing (grammar/style)Match tense/capitalization.
- - **Description**: check git branch name following [Conventional Branch](https://conventional-branch.github.io/). + - **Description**: Check Git branch names follow [Conventional Branch](https://conventional-branch.github.io/).
131-131
: Clarify note (grammar + clarity)Small grammar polish and clearer wording.
-Note: the default rule of above inputs is following [this configuration](https://github.com/commit-check/commit-check-action/blob/main/commit-check.toml). If you want to customize, just add your [`commit-check.toml`](https://commit-check.github.io/commit-check/configuration.html) config file under your repository root directory. +Note: the default behavior of the inputs above follows [this configuration](https://github.com/commit-check/commit-check-action/blob/main/commit-check.toml). To customize, add a [`commit-check.toml`](https://commit-check.github.io/commit-check/configuration.html) file at the root of your repository.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
README.md
(4 hunks)
🔇 Additional comments (4)
README.md (4)
11-22
: v2 summary reads wellClear breaking changes and migration notes. Looks good.
54-54
: Confirm need for full history with v2Is
fetch-depth: 0
still required for default v2 config? If merge-base rules are disabled, considerfetch-depth: 1
for speed. If enabled via commit-check.toml, keep0
.
61-62
: Defaults change acknowledgedSetting
author-name
andauthor-email
to false matches v2 defaults. Good.
104-104
: Default notedDefault value update documented correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
README.md (1)
53-58
: Example checkout must include a fallback ref.The Usage snippet runs on
push
, butgithub.event.pull_request.head.ref
is empty there, so anyone copying this fails checkout. Reintroduce a fallback (e.g.|| github.ref_name
) to keep the example runnable.- ref: ${{ github.event.pull_request.head.ref }} # Checkout PR branch - fetch-depth: 0 # Required for merge-base checks + ref: ${{ github.event.pull_request.head.ref || github.ref_name }} # PR branch on PRs; branch on push/dispatch + fetch-depth: 0 # Required for merge-base checks - uses: commit-check/commit-check-action@v2 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for PR comments + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for PR comments
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/commit-check.yml
(1 hunks)README.md
(4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
.github/workflows/commit-check.yml (1)
main.py (2)
main
(197-210)add_pr_comments
(111-177)
ref: ${{ github.event.pull_request.head.ref }} # Checkout PR branch | ||
fetch-depth: 0 # Required for merge-base checks | ||
- uses: ./ # self test | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # use GITHUB_TOKEN because of use pr-comments | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for PR comments | ||
with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restore checkout fallback for non-PR runs.
github.event.pull_request.head.ref
is undefined during workflow_dispatch
, so checkout receives an empty ref
and the workflow aborts on manual runs. Please fall back to github.ref_name
/github.sha
so both PR and dispatch executions work.
- ref: ${{ github.event.pull_request.head.ref }} # Checkout PR branch
+ ref: ${{ github.event.pull_request.head.ref || github.ref_name }} # PR branch on PRs; dispatch/push fallback
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
ref: ${{ github.event.pull_request.head.ref }} # Checkout PR branch | |
fetch-depth: 0 # Required for merge-base checks | |
- uses: ./ # self test | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # use GITHUB_TOKEN because of use pr-comments | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for PR comments | |
with: | |
ref: ${{ github.event.pull_request.head.ref || github.ref_name }} # PR branch on PRs; dispatch/push fallback | |
fetch-depth: 0 # Required for merge-base checks | |
- uses: ./ # self test | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for PR comments | |
with: |
🤖 Prompt for AI Agents
.github/workflows/commit-check.yml around lines 17 to 22: the checkout step
currently uses github.event.pull_request.head.ref which is undefined for
workflow_dispatch and causes failures; change the ref input to fall back to a
dispatch/commit ref by using a conditional expression that uses
github.event.pull_request.head.ref when present, otherwise github.ref_name (or
github.sha) so manual runs and PR runs both work; update the env/with block to
set ref: to that fallback expression (e.g. use the GitHub Actions expression OR
chain) so checkout always receives a valid ref.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subject_imperative = true | ||
subject_max_length = 80 | ||
subject_min_length = 5 | ||
allow_commit_types = ["feat", "fix", "docs", "style", "refactor", "test", "chore", "ci"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restore the full Conventional Commit type set.
We reference the Conventional Commits spec here, but allow_commit_types
omits core types like build
and perf
. Any contributors using those standard types will now be blocked. Please add the missing spec-defined types so we don’t introduce false negatives.
-allow_commit_types = ["feat", "fix", "docs", "style", "refactor", "test", "chore", "ci"]
+allow_commit_types = ["feat", "fix", "docs", "style", "refactor", "test", "chore", "ci", "build", "perf"]
🤖 Prompt for AI Agents
In commit-check.toml at line 8, the allow_commit_types list omits standard
Conventional Commit types (e.g., build, perf, revert) which will block valid
commits; update the allow_commit_types array to include the missing spec-defined
types such as build, perf, and revert (in addition to the existing entries) so
the configuration accepts the full conventional set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (1)
README.md (1)
53-55
: Make checkout ref robust for push and PR (and fork PRs); clarify fetch-depth commentUsing
github.event.pull_request.head.ref
fails on push events and can target a non-existent branch on forks. Prefer a SHA fallback so the example works across events. Also clarify why full history is needed.- ref: ${{ github.event_pull_request.head.ref }} # Checkout PR branch - fetch-depth: 0 # Required for merge-base checks + ref: ${{ github.event.pull_request.head.sha || github.sha }} # PR HEAD on pull_request; current SHA on push + fetch-depth: 0 # Full history required for range/merge-base computations
🧹 Nitpick comments (2)
README.md (2)
11-22
: Add “What’s New in v2” to the Table of ContentsImprove discoverability by adding this section to the TOC near the top.
131-131
: Tighten wording for clarityMinor grammar/readability improvement.
-Note: the default rule of above inputs is following [this configuration](https://github.com/commit-check/commit-check-action/blob/main/commit-check.toml). If you want to customize, just add your [`commit-check.toml`](https://commit-check.github.io/commit-check/configuration.html) config file under your repository root directory. +Note: defaults for the above inputs are defined by [this configuration](https://github.com/commit-check/commit-check-action/blob/main/commit-check.toml). To customize, add your own [`commit-check.toml`](https://commit-check.github.io/commit-check/configuration.html) at the repository root.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
README.md
(4 hunks)
🔇 Additional comments (5)
README.md (5)
57-57
: LGTM: token/env and permissions alignmentUsing
GITHUB_TOKEN
withpull-requests: write
matches the PR comments guidance.
61-62
: LGTM: updated defaults for author checksDefaults set to
false
align with v2 breaking changes.
93-93
: LGTM: Conventional Commits descriptionDescription accurately reflects enforcement.
98-98
: LGTM: Conventional Branches linkGood reference to the spec.
104-104
: LGTM: default clarifiedDefault
false
matches the new behavior.
What's New in v2
Important
This v2 release introduces several 🚨breaking changes. Please review the Breaking Changes section carefully before upgrading.
Breaking Changes
commit-signoff
,merge-base
, andimperative
inputs — now configured viacommit-check.toml
orcchk.toml
..commit-check.yml
in favor ofcommit-check.toml
orcchk.toml
.author-name
andauthor-email
inputs tofalse
to align with the default behavior in commit-check.commit-check
to v2.0.0.Summary by CodeRabbit
New Features
Documentation
Chores
Workflows